# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=qt5-qt3d
pkgver=5.15.0
pkgrel=0
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
url="https://www.qt.io/developers/"
license="LGPL-2.1-only AND LGPL-3.0-only AND GPL-3.0-only AND Qt-GPL-exception-1.0"
pkgdesc="C++ and QML APIs for easy inclusion of 3D graphics"
makedepends="qt5-qtbase-dev qt5-qtdeclarative-dev vulkan-headers"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/qt3d-everywhere-src-$pkgver"

case $pkgver in
	*_beta*|*_rc*) _rel=development_releases;;
	*) _rel=official_releases;;
esac

source="http://download.qt.io/$_rel/qt/${pkgver%.*}/$pkgver/submodules/qt3d-everywhere-src-$pkgver.tar.xz"

build() {
	qmake-qt5
	make
}

check() {
	make check
}

package() {
	make INSTALL_ROOT="$pkgdir" install

	# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
	find "$pkgdir/usr/lib" -type f -name '*.prl' \
		-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

	install -d "$pkgdir"/usr/share/licenses
	ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/$pkgname
}
sha512sums="0cc327438ec174bfc6b7b560b5957653d38cdcb1c94717e296c3f52f41750f1b95ad620e3c3777fdc9c63f885f8325b8c1d1befcc338a25fc65d3f62b2019185  qt3d-everywhere-src-5.15.0.tar.xz"
